# Maintainer: Maxime Gauduin <alucryd@archlonux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=libva1
pkgver=1.8.3
pkgrel=3
pkgdesc='Video Acceleration (VA) API for Linux'
arch=('loong64' 'x86_64')
url='https://01.org/linuxmedia/vaapi'
license=('MIT')
depends=('libdrm' 'libgl' 'libx11' 'libxext' 'libxfixes' 'wayland')
makedepends=('git' 'libglvnd' 'mesa')
provides=(
  'libva-drm.so' 'libva-glx.so' 'libva-wayland.so' 'libva-x11.so' 'libva.so'
)
source=("git+https://github.com/intel/libva.git#tag=${pkgver}"
        '50-libva1.conf')
sha256sums=('SKIP'
            '0b492e511aec4319b7da6d5e02a85d4d092ed13fd5d2b01832452ebf21c1aac7')

prepare() {
  cd libva

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd libva

  ./configure \
    --prefix='/usr' \
    --includedir='/usr/include/libva1' \
    --libdir='/usr/lib/libva1' \
    --with-drivers-path='/usr/lib/libva1/dri' \
    --disable-va-messaging
  make
}

package() {
  make DESTDIR="${pkgdir}" -C libva install
  install -Dm 644 libva/COPYING -t "${pkgdir}"/usr/share/licenses/libva1
  install -Dm 644 50-libva1.conf -t "${pkgdir}"/etc/ld.so.conf.d/
}

# vim: ts=2 sw=2 et:
